﻿Public Class WebForm1
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Savedata()
    End Sub
    Protected Sub Savedata()
        Try
            Dim db As New MyDataEntities


            'db.G()

            Dim obj As New BIO_DATA
            With obj
                .FIRSTNAME = "Test"
                .SURNAME = "Efe"
            End With
            db.AddObject("BIO_DATA", obj)
            '    db.AddToBIO_DATA(obj)
            Dim kk As Integer = db.SaveChanges()
            'Dim query1 = (From c In db.BIO_DATA Where c.ID = 12 Select c).FirstOrDefault
            'If query1 Is Nothing Then
            '    Exit Sub
            'End If
            ' db.DeleteObject(query1)
            'db.SaveChanges()


            Dim query = (From c In db.BIO_DATA Where c.ID = 4 Select c.FIRSTNAME, c.SURNAME).FirstOrDefault
            If query Is Nothing Then
                Exit Sub
            End If
            Dim check = query
            Dim mario = query.FIRSTNAME
            Dim mario1 = query.SURNAME
            'query.SURNAME = "Micheal"
            '   db.SaveChanges()


            'Using workTrackerDbEntities = New MyDataEntities()

            '    Dim bioObj = (From g In workTrackerDbEntities.BIO_DATA Where (g.ID = 1) Select g).FirstOrDefault
            '    '  Dim bioObj1 As System.Data.Objects.ObjectQuery(Of BIO_DATA) = From g In workTrackerDbEntities.BIO_DATA Where (g.ID = 1) Select g
            '    ' Dim bioObj As System.Data.Objects.ObjectQuery(Of BIO_DATA) = getUserFk

            '    Dim text3 = bioObj.SURNAME


            'End Using
        Catch ex As Exception

        End Try
    End Sub
End Class